<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simGetJointForce</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simGetJointForce" id="simGetJointForce"></a>simGetJointForce / sim.getJointForce</h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Retrieves the force or torque applied to a joint  along/about its active axis. This function retrieves meaningful information only if the joint is prismatic or revolute, and is dynamically enabled. With the <a href="../dynamicsModule.htm#bullet">Bullet</a> engine, this function returns the force or torque applied to the joint motor  (torques from joint limits are not taken into account). With the <a href="../dynamicsModule.htm#ode">ODE</a> and <a href="../dynamicsModule.htm#vortex">Vortex</a> engine, this function returns the total force or torque applied to a joint  along/about its z-axis. See also <a href="simSetJointMaxForce.htm">sim.setJointMaxForce</a> and <a href="simReadForceSensor.htm">sim.readForceSensor</a>.<br></td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simGetJointForce(simInt jointHandle,simFloat* forceOrTorque)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>jointHandle</strong>: handle of the joint. Can be combined with <a href="../apiConstants.htm#specialHandleFlags">sim_handleflag_rawvalue</a> (simply add sim_handleflag_rawvalue to jointHandle), if you wish to access the raw values generated by each individual dynamic simulation step (by default, there are 10 dynamic simulation steps for each simulation step). Raw values can only be accessed from inside a <a href="../callbackFunctions.htm">callback function</a> triggered by the physics engine.</div>
<div><strong>forceOrTorque</strong>: the force or the torque applied to the joint  along/about its z-axis.
</div>
<div></div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>-1 if operation was not successful. 0 if no value is available yet (e.g. when <a href="simHandleDynamics.htm">simHandleDynamics</a> hasn't yet handled that joint), otherwise a value &gt;0.<br>
</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>float forceOrTorque=sim.getJointForce(int jointHandle)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div>Similar to the C-function counterpart</div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div><strong>forceOrTorque</strong>: the force or the torque applied to the joint  along/about its z-axis, or nil if no value is available yet.</div></td> 
</tr> 

<tr class=apiTableTr> 
<td class=remApiTableLeftCParam>
Remote API equiv.
</td> 
<td class=remApiTableRightCParam>
<div>B0-based remote API: <a href="../b0RemoteApi-cpp.htm#simxGetJointForce">simxGetJointForce</a></div>
<div>Legacy remote API: <a href="../remoteApiFunctions.htm#simxGetJointForce">simxGetJointForce</a></div>
</td> 
</tr> 

</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
